import request from '../../../utils/request'
import { IResponseBase } from '../../user/type'
import type { IResponseTradeMark, ITrademarkParam } from './type'
export const getTradeMark = (page: number, limit: number) =>
  request.get<any, IResponseTradeMark>(
    `/admin/product/baseTrademark/${page}/${limit}`,
  )

export const reqAddOrUpdateTrademark = (data: ITrademarkParam) => {
  if (data.id) {
    // /admin/product/baseTrademark/update
    return request.put<any, IResponseBase>(
      '/admin/product/baseTrademark/update',
      data,
    )
  } else {
    return request.post<any, IResponseBase>(
      '/admin/product/baseTrademark/save',
      data,
    )
  }
}

export const reqDeleteTrademark = (id: string) =>
  request.delete<any, IResponseBase>(
    `/admin/product/baseTrademark/remove/${id}`,
  )
